3.2.57 \(\int x^3 \sqrt {a-a \cos (x)} \, dx\) [157]

Optimal. Leaf size=72 \[ -96 \sqrt {a-a \cos (x)}+12 x^2 \sqrt {a-a \cos (x)}+48 x \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )-2 x^3 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right ) \]

[Out]

-96*(a-a*cos(x))^(1/2)+12*x^2*(a-a*cos(x))^(1/2)+48*x*cot(1/2*x)*(a-a*cos(x))^(1/2)-2*x^3*cot(1/2*x)*(a-a*cos(
x))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 72, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3400, 3377, 2717} \begin {gather*} -2 x^3 \cot \left (\frac {x}{2}\right ) \sqrt {a-a \cos (x)}+12 x^2 \sqrt {a-a \cos (x)}-96 \sqrt {a-a \cos (x)}+48 x \cot \left (\frac {x}{2}\right ) \sqrt {a-a \cos (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^3*Sqrt[a - a*Cos[x]],x]

[Out]

-96*Sqrt[a - a*Cos[x]] + 12*x^2*Sqrt[a - a*Cos[x]] + 48*x*Sqrt[a - a*Cos[x]]*Cot[x/2] - 2*x^3*Sqrt[a - a*Cos[x
]]*Cot[x/2]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3400

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(2*a)^IntPart[n]
*((a + b*Sin[e + f*x])^FracPart[n]/Sin[e/2 + a*(Pi/(4*b)) + f*(x/2)]^(2*FracPart[n])), Int[(c + d*x)^m*Sin[e/2
 + a*(Pi/(4*b)) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[n
 + 1/2] && (GtQ[n, 0] || IGtQ[m, 0])

Rubi steps

\begin {align*} \int x^3 \sqrt {a-a \cos (x)} \, dx &=\left (\sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int x^3 \sin \left (\frac {x}{2}\right ) \, dx\\ &=-2 x^3 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )+\left (6 \sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int x^2 \cos \left (\frac {x}{2}\right ) \, dx\\ &=12 x^2 \sqrt {a-a \cos (x)}-2 x^3 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )-\left (24 \sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int x \sin \left (\frac {x}{2}\right ) \, dx\\ &=12 x^2 \sqrt {a-a \cos (x)}+48 x \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )-2 x^3 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )-\left (48 \sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int \cos \left (\frac {x}{2}\right ) \, dx\\ &=-96 \sqrt {a-a \cos (x)}+12 x^2 \sqrt {a-a \cos (x)}+48 x \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )-2 x^3 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 34, normalized size = 0.47 \begin {gather*} -2 \sqrt {a-a \cos (x)} \left (-6 \left (-8+x^2\right )+x \left (-24+x^2\right ) \cot \left (\frac {x}{2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^3*Sqrt[a - a*Cos[x]],x]

[Out]

-2*Sqrt[a - a*Cos[x]]*(-6*(-8 + x^2) + x*(-24 + x^2)*Cot[x/2])

________________________________________________________________________________________

Maple [C] Result contains complex when optimal does not.
time = 0.06, size = 86, normalized size = 1.19

method result size
risch \(-\frac {i \sqrt {2}\, \sqrt {-a \left ({\mathrm e}^{i x}-1\right )^{2} {\mathrm e}^{-i x}}\, \left (6 i x^{2} {\mathrm e}^{i x}+x^{3} {\mathrm e}^{i x}-6 i x^{2}+x^{3}-48 i {\mathrm e}^{i x}-24 x \,{\mathrm e}^{i x}+48 i-24 x \right )}{{\mathrm e}^{i x}-1}\) \(86\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^3*(a-a*cos(x))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-I*2^(1/2)*(-a*(exp(I*x)-1)^2*exp(-I*x))^(1/2)/(exp(I*x)-1)*(6*I*x^2*exp(I*x)+x^3*exp(I*x)-6*I*x^2+x^3-48*I*ex
p(I*x)-24*x*exp(I*x)+48*I-24*x)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 129 vs. \(2 (60) = 120\).
time = 0.53, size = 129, normalized size = 1.79 \begin {gather*} -{\left ({\left (6 \, \sqrt {2} x^{2} - 6 \, {\left (\sqrt {2} x^{2} - 8 \, \sqrt {2}\right )} \cos \left (x\right ) - {\left (\sqrt {2} x^{3} - 24 \, \sqrt {2} x\right )} \sin \left (x\right ) - 48 \, \sqrt {2}\right )} \cos \left (\frac {1}{2} \, \pi + \frac {1}{2} \, \arctan \left (\sin \left (x\right ), \cos \left (x\right )\right )\right ) + {\left (\sqrt {2} x^{3} + {\left (\sqrt {2} x^{3} - 24 \, \sqrt {2} x\right )} \cos \left (x\right ) - 6 \, {\left (\sqrt {2} x^{2} - 8 \, \sqrt {2}\right )} \sin \left (x\right ) - 24 \, \sqrt {2} x\right )} \sin \left (\frac {1}{2} \, \pi + \frac {1}{2} \, \arctan \left (\sin \left (x\right ), \cos \left (x\right )\right )\right )\right )} \sqrt {a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*(a-a*cos(x))^(1/2),x, algorithm="maxima")

[Out]

-((6*sqrt(2)*x^2 - 6*(sqrt(2)*x^2 - 8*sqrt(2))*cos(x) - (sqrt(2)*x^3 - 24*sqrt(2)*x)*sin(x) - 48*sqrt(2))*cos(
1/2*pi + 1/2*arctan2(sin(x), cos(x))) + (sqrt(2)*x^3 + (sqrt(2)*x^3 - 24*sqrt(2)*x)*cos(x) - 6*(sqrt(2)*x^2 -
8*sqrt(2))*sin(x) - 24*sqrt(2)*x)*sin(1/2*pi + 1/2*arctan2(sin(x), cos(x))))*sqrt(a)

________________________________________________________________________________________

Fricas [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*(a-a*cos(x))^(1/2),x, algorithm="fricas")

[Out]

Exception raised: TypeError >>  Error detected within library code:   integrate: implementation incomplete (ha
s polynomial part)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x^{3} \sqrt {- a \left (\cos {\left (x \right )} - 1\right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**3*(a-a*cos(x))**(1/2),x)

[Out]

Integral(x**3*sqrt(-a*(cos(x) - 1)), x)

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 55, normalized size = 0.76 \begin {gather*} -2 \, \sqrt {2} {\left ({\left (x^{3} \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right ) - 24 \, x \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right )\right )} \cos \left (\frac {1}{2} \, x\right ) - 6 \, {\left (x^{2} \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right ) - 8 \, \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right )\right )} \sin \left (\frac {1}{2} \, x\right )\right )} \sqrt {a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^3*(a-a*cos(x))^(1/2),x, algorithm="giac")

[Out]

-2*sqrt(2)*((x^3*sgn(sin(1/2*x)) - 24*x*sgn(sin(1/2*x)))*cos(1/2*x) - 6*(x^2*sgn(sin(1/2*x)) - 8*sgn(sin(1/2*x
)))*sin(1/2*x))*sqrt(a)

________________________________________________________________________________________

Mupad [B]
time = 0.43, size = 92, normalized size = 1.28 \begin {gather*} \frac {2\,\sqrt {a}\,\sqrt {1-\cos \left (x\right )}\,\left (24\,x+\cos \left (x\right )\,48{}\mathrm {i}-48\,\sin \left (x\right )-x^2\,\cos \left (x\right )\,6{}\mathrm {i}-x^3\,\cos \left (x\right )+6\,x^2\,\sin \left (x\right )-x^3\,\sin \left (x\right )\,1{}\mathrm {i}+24\,x\,\cos \left (x\right )+x\,\sin \left (x\right )\,24{}\mathrm {i}+x^2\,6{}\mathrm {i}-x^3-48{}\mathrm {i}\right )}{\sin \left (x\right )-\cos \left (x\right )\,1{}\mathrm {i}+1{}\mathrm {i}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^3*(a - a*cos(x))^(1/2),x)

[Out]

(2*a^(1/2)*(1 - cos(x))^(1/2)*(24*x + cos(x)*48i - 48*sin(x) - x^2*cos(x)*6i - x^3*cos(x) + 6*x^2*sin(x) - x^3
*sin(x)*1i + 24*x*cos(x) + x*sin(x)*24i + x^2*6i - x^3 - 48i))/(sin(x) - cos(x)*1i + 1i)

________________________________________________________________________________________